<!DOCTYPE html>
<html>
<head>
    <!-- 定义页面编码和响应式视口 -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 页面标题 -->
    <title>修改密码 - 留言板</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
        }
        body {
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }
        a {
            color: #3498db;
            text-decoration: none;
            transition: color 0.3s;
        }
        a:hover {
            color: #2980b9;
            text-decoration: underline;
        }
        .container {
            width: 90%;
            max-width: 450px;
            padding: 30px;
            background-color: #fff;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            border-radius: 5px;
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
        }
        .header h1 {
            color: #2c3e50;
            font-size: 24px;
            margin-bottom: 10px;
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 8px;
            color: #2c3e50;
            font-weight: 500;
        }
        input[type="password"] {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            transition: border-color 0.3s;
        }
        input[type="password"]:focus {
            border-color: #3498db;
            outline: none;
            box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
        }
        .btn {
            display: block;
            width: 100%;
            background-color: #3498db;
            color: white;
            border: none;
            padding: 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
        }
        .btn:hover {
            background-color: #2980b9;
        }
        .error-message {
            color: #e74c3c;
            margin-bottom: 15px;
            padding: 10px;
            background-color: #fadbd8;
            border-radius: 4px;
            text-align: center;
        }
        .success-message {
            color: #27ae60;
            margin-bottom: 15px;
            padding: 10px;
            background-color: #d4efdf;
            border-radius: 4px;
            text-align: center;
        }
        .links {
            text-align: center;
            margin-top: 20px;
            color: #7f8c8d;
            font-size: 14px;
        }
        .links a {
            margin: 0 10px;
        }
        .form-tip {
            font-size: 12px;
            color: #7f8c8d;
            margin-top: 5px;
        }
        @media (max-width: 480px) {
            .container {
                width: 95%;
                padding: 20px;
            }
        }
    </style>
</head>
<body>
    <!-- 修改密码表单容器 -->
    <div class="container">
        <!-- 页面标题区域 -->
        <div class="header">
            <h1>修改密码</h1>
        </div>
        
        <!-- 错误信息显示区域：仅当有错误时显示 -->
        {if condition="isset($error)"}
        <div class="error-message">
            {$error}
        </div>
        {/if}
        
        <!-- 成功信息显示区域：仅当操作成功时显示 -->
        {if condition="isset($success)"}
        <div class="success-message">
            {$success}
        </div>
        {/if}
        
        <!-- 修改密码表单 -->
        <form action="{:url('user/changePassword')}" method="post">
            <!-- 原密码输入框 -->
            <div class="form-group">
                <label for="old_password">原密码</label>
                <input type="password" id="old_password" name="old_password" required>
            </div>
            <!-- 新密码输入框 -->
            <div class="form-group">
                <label for="new_password">新密码</label>
                <input type="password" id="new_password" name="new_password" required>
                <!-- 密码输入提示 -->
                <div class="form-tip">密码长度为6-20个字符</div>
            </div>
            <!-- 确认新密码输入框 -->
            <div class="form-group">
                <label for="confirm_password">确认新密码</label>
                <input type="password" id="confirm_password" name="confirm_password" required>
            </div>
            <!-- 提交按钮 -->
            <div class="form-group">
                <button type="submit" class="btn">修改密码</button>
            </div>
        </form>
        
        <!-- 页面底部链接区域 -->
        <div class="links">
            <a href="{:url('index/index')}">返回首页</a>
        </div>
    </div>
</body>
</html> 